<?php
include('header.php');
$account = "current_page_item";
include('nav.php');
?>

<div class="primary">

<?php
$user = get_user();
if($user !== NULL){
	
  $emailquery = "select email from users where user='$user'";
  $user_email = mysql_fetch_array(mysql_query($emailquery), MYSQL_ASSOC);
  $user_email = $user_email['email'];

?>
<b>Edit information for user <em><?php echo $user; ?></em></b><br/><br/>
<form action="account_form.php" method="post">
	<label for="email"><b>Email:</b></label>
	<input name="email" type="text" id="email" size="25" value="<?php echo $user_email; ?>"/>
	<input type="hidden" name="action" value="change_email"/>
	<input type="submit" id="submit" value="Submit Changes"/>
</form>

<br/><br/>
<form action="account_form.php" method="post">
	You may delete your user account if you want.
	<input type="submit" id="submit" value="Delete Account"/>
	<input type="hidden" name="action" value="delete_account"/>
</form>

<? } else { ?>
	<p>Please login to use this feature.</p>
<?php } ?>
  
</div>
<?php include('footer.php'); ?>